package com.liwei.vip.mall.goods.controller;


import com.liwei.mall.util.RespResult;
import com.liwei.vip.mall.goods.model.SkuAttribute;
import com.liwei.vip.mall.goods.service.SkuAttributeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/skuAttributeService")
public class SkuAttributeController {

    @Autowired
    private SkuAttributeService skuAttributeService;

    /**
     * 根据分类ID查询属性ID集合
     * @param id
     * @return
     */
    @GetMapping("/category/{id}")
    public RespResult<List<SkuAttribute>> categorySkuAttributeList(@PathVariable(value = "id") Integer id) {
        return RespResult.ok(skuAttributeService.queryList(id));
    }

}
